package com.xbs.utils;

import java.sql.Date;
import java.text.ParseException;
import java.util.Calendar;

/**
 * 计算时间，
 * @author dell
 */
public class TimeUtils {
	/**
     * <li>功能描述：时间相减得到天数
     * @param beginDateStr
     * @param endDateStr
     * @return
     * long 
     * @author qzm
     */
    public static int getDaySub(Date beginDate,Date endDate)
    {
    	Calendar begin=Calendar.getInstance();//创建日历对象
		Calendar end=Calendar.getInstance();//创建日历对象
		//Date fromDate = Date.valueOf(beginDate);
		//Date toDate = Date.valueOf(endDate);
		begin.setTime(beginDate);
		end.setTime(endDate);
		int day=end.get(end.DAY_OF_YEAR)-begin.get(begin.DAY_OF_YEAR);
		return day;
	
    }
}
